using System;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Text;

namespace Monorf.Net
{
    public class Handle
    {
        protected Socket m_socket = null;
        protected EventType m_lastEvent = EventType.Accept;
        protected AddressEndPoint m_address = null;
        protected Boolean m_inUse = false;
        private static Object m_lock = new Object();

        public Handle(AddressEndPoint address)
        {
            m_address = address;
        }


        #region properties

        /// <summary>
        /// lock object
        /// </summary>
        public Object Lock { get { return m_lock; }}

        /// <summary>
        /// socket to listen
        /// </summary>
        public Socket ListenSocket { get { return m_socket; } }

        /// <summary>
        /// local address to listen
        /// </summary>
        public AddressEndPoint LocalAddress { get {return  m_address; } }

        ///// <summary>
        ///// return last event handled
        ///// </summary>
        //public EventType LastEvent { get { return m_lastEvent; } }

        ///// <summary>
        ///// 
        ///// </summary>
        //public Boolean InUse { get { return m_inUse; } }

        ///// <summary>
        ///// handle socket
        ///// </summary>
        //public Socket Socket { get { return m_socket; } }

        //#endregion


        //#region public methods

        ///// <summary>
        ///// wait event 
        ///// </summary>
        ///// <param name="timeOut"></param>
        ///// <param name="initiationDispatcher"></param>
        //public void WaitForEvent(TimeSpan timeout, Object initiationDispatcher)
        //{

        //}

        //public void WaitForDeath()
        //{

        //}

        //public void Kill()
        //{

        //}
        //public void Read(Byte[] buffer)
        //{
        //}

        //public TData Read<TData>()
        //{
        //    return default(TData);
        //}

        //public void Write(EventType ev)
        //{
        //}

        //public void Write(Byte buffer)
        //{
        //}

        //public void Write<TData>(TData data)
        //{

        //}

        #endregion

    }
}
